﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel.Composition;
using DemoInterface;
using DemoDAL;

namespace DemoPlugs.Frm
{
    [ExportMetadata("Name", "FrmMain")]
    [Export(typeof(IForm))]
    public partial class FrmMain : FrmBase, IForm
    {
        public FrmMain()
        {
            InitializeComponent();
            this.Text = base.Text + " - 主窗体";
        }

        public string Title
        {
            get { return "FrmMain"; }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FrmTwo ft = new FrmTwo();
            ft.ShowInTaskbar = false;
            ft.ShowDialog();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            this.menuStrip1.Items.Clear();
            ToolStripItem[] items = new ModelMenu().GetMenu();
            for (int i = 0; i < items.Length; i++)
            {
                items[i].Click += StripItem_Click;
            }
            this.menuStrip1.Items.AddRange(items);
        }

        void StripItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("哈哈");
        }
    }
}
